
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  <title>捎单列表</title>
  <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  <link rel="stylesheet" type="text/css" href="../../css/style.css" />
  <script type="text/javascript" src="../../script/api.js"></script>
    <style type="text/css">
    .empty {
        margin: 0px auto;
    }
    .top{
      width:100%;
      height: 40px;
      margin: 40px auto 0px;
      background: #f5f5f5;
      color:#000;
      border:0px;
      display: block;
      text-align: center;
    }
    .leftreturn{
      position: absolute;
      left:5px;
      z-index: 5;
      background-image: url("../../image/leftreturn.png");
      background-position: 0px 0px;
      width:25px;
      height:25px;
      margin:7.5px 0;
    }
    .top-title{
      line-height: 40px;
      font-size: 20px;
    }
.content{
	width:100%;
	height: 450px;
	margin: 0 auto;
	margin-top: 0;
	background: white;
	color:#000000;
	border:0px;
	display: block;
	font-size: 14px;
}
.content-xinxi{
	width:100%;
	height: 300px;
	margin: 0 auto;
	background: white;
	color:#000000;
	border:0px;
	display: block;
	font-size: 17px;
	margin-top: 20px;
	border-bottom: solid;
	border-color: #999999;
}
.content-text{
	width:90%;
	height: 30px;
	margin: 0 auto;
	margin-top: 0;
	color:#000000;
	border:1px;
	border-style: solid;
	border-color: #999999;
	display: block;
	font-size: 14px;
}
.button {
	width:80%;
	height: 40px;
	margin: 0 auto;
	margin-top: 15px;
	background: #0082e4;
	color:#FFFFFF;
	font-size: 18px;
	border:0px;
	display: block;
  border-radius: 6px;
}
    </style>
</head>
<body>
  <div class="empty">
    	<div class="top">
        <i class="leftreturn" onclick="Winclose();"></i>
    		<h1 class="top-title">捎单列表</h1>
    	</div>
    	<div class="content" id="content">
    	</div>


  </div>

</body>

<script type="text/x-dot-template"id="tmpl">
{{ for(var prop in it) { }}
<div class="content-xinxi">

  <table width="100%" padding="3px">
    <tr>
      <td width="30%" style="height:30px;line-height: 30px;font-size: 14px;">捎单发布人：</td>
      <td width="70%" style="height:30px;line-height: 30px;font-size: 14px;padding-left: 10px;">{{=it[prop].username}}</td>
    </tr>
    <tr>
      <td width="30%" style="height:30px;line-height: 30px;font-size: 16px;">发布人电话：</td>
      <td width="70%" style="height:30px;line-height: 30px;font-size: 16px;padding-left: 10px;">{{=it[prop].senderphone}}</td>
    </tr>
    <tr>
      <td width="30%" style="height:30px;line-height: 30px;font-size: 16px;">揽货时间：</td>
      <td width="70%" style="height:30px;line-height: 30px;font-size: 16px;padding-left: 10px;">{{=it[prop].time}}</td>
    </tr>
    <tr>
      <td width="30%" style="height:30px;line-height: 30px;font-size: 16px;">物品名称：</td>
      <td width="70%" style="height:30px;line-height: 30px;font-size: 16px;padding-left: 10px;">{{=it[prop].cname}}</td>
    </tr>
    <tr>
      <td width="30%" style="height:30px;line-height: 30px;font-size: 16px;">物品重量：</td>
      <td width="70%" style="height:30px;line-height: 30px;font-size: 16px;padding-left: 10px;">{{=it[prop].weight}}</td>
    </tr>
    <tr>
      <td width="30%" style="height:30px;line-height: 30px;font-size: 16px;">物品体积：</td>
      <td width="70%" style="height:30px;line-height: 30px;font-size: 16px;padding-left: 10px;">{{=it[prop].volume}}</td>
    </tr>
  </table>
</div>
{{ } }}
</script>


<script type="text/javascript" src="../../script/SHA1.js"></script>
<script type="text/javascript" src="../../script/doT.min.js"></script>
<script type="text/javascript">

apiready=function(){


  //将商品数据从数据库中拿出来
 //获取X-APICloud-AppKey值
 var now = Date.now();
 appKey = SHA1("A6032422409194"+"UZ"+"808CF36B-60D4-DC5D-C9F3-FB49F9E1FB44"+"UZ"+now)+"."+now


           var params = {
               fields: {},
               skip: 0,
               limit: false
           }

           //将json转换成string
           params = $api.jsonToStr(params);

           api.ajax({
               url: 'https://d.apicloud.com/mcm/api/orderform?filter=' + params,
               method: 'get',
               cache: false,
               headers:{
                 "X-APICloud-AppId": "A6032422409194",
                 "X-APICloud-AppKey": appKey
               }
           },function(ret, err){
               if (ret) {
                   $api.setStorage('orderform', ret);

                     //使用doT模板将用户信息放入html中
                     // 编译模板函数
                     tmpltxt=doT.template(document.getElementById("tmpl").innerHTML);//生成模板方法
                     document.getElementById("content").innerHTML=tmpltxt(ret);//数据渲染

               } else {
                   alert('数据库连接失败');
               }
           });
}

      //选择提交
      function xiadan(){
          alert('选择成功！点击确定开始发货');
      }


      function Winclose() {
      api.closeWin();
     }
</script>

</html>
